package com.paipaideli.common.utils.preferrnces;


import com.paipaideli.MyApplication;

/**
 * Created by wangJia on 2017/3/16.
 */

public class FastData extends Remember {

    private static final String HEADER_TOKEN = "login::header::token";
    private static final String HEADER_IS_LOGIN = "login::check::is:login";
    private static final String SHARED_PREFS_NAME = "tticar.persistence";
    private static final String SHARED_USER_NAME = "login::user::name";
    private static final String SHARED_USER_PWD = "login::user::pwd";
    private static final String USER_IS_REMEMBER_PWD = "login::user::is::remember::account";
    private static final String SHARED_USER_PHONE = "login::user::phone";
    private static final String FIRST_IN_APP = "first:in:app";
    private static final String head_image = "head_image";
    private static final String outTradeNo = "outTradeNo";
    private static final String referralCode = "referralCode";
    private static final String TIME = "time";

    private static final String GOODNAME = "goodName";
    private static final String GOODIMAGE = "goodImage";
    private static final String GOODPRICE = "goodPrice";

    public static synchronized Remember getInstance() {
        return Remember.init(MyApplication.getInstanse(), SHARED_PREFS_NAME);
    }

    public static void setToken(String token) {
        Remember.putString(HEADER_TOKEN, token);
    }

    public static String getToken() {
        return Remember.getString(HEADER_TOKEN, "");
    }

    public static void setPhone(String phone) {
        Remember.putString(SHARED_USER_PHONE, phone);
    }

    public static String getPhone() {
        return Remember.getString(SHARED_USER_PHONE, "");
    }

    public static void setIsLogin(boolean isLogin) {
        Remember.putBoolean(HEADER_IS_LOGIN, isLogin);
    }

    public static boolean isLogin() {
        return Remember.getBoolean(HEADER_IS_LOGIN, false);
    }


    public static void setUsername(String username) {
        Remember.putString(SHARED_USER_NAME, username);
    }

  public static void setReferralCode(String referralCodes) {
        Remember.putString(referralCode, referralCodes);
    }

    public static String getUsername() {
        return Remember.getString(SHARED_USER_NAME, "");
    }

    public static String getReferralCode() {
        return Remember.getString(referralCode, "");
    }

    public static void setUserPwd(String pwd) {
        Remember.putString(SHARED_USER_PWD, pwd);
    }

    public static String getUserPwd() {
        return Remember.getString(SHARED_USER_PWD, "");
    }

    public static void setIsRememberPwd(boolean isRememberPwd) {
        Remember.putBoolean(USER_IS_REMEMBER_PWD, isRememberPwd);
    }

    public static boolean getIsRememberPwd() {
        return Remember.getBoolean(USER_IS_REMEMBER_PWD, false);
    }

    public static void setHead_image(String area) {
        Remember.putString(head_image, area);
    }

    public static String getHead_image() {
        return Remember.getString(head_image, "");
    }

    public static void setFirstInApp(boolean firstInApp) {
        Remember.putBoolean(FIRST_IN_APP, firstInApp);
    }

    public static boolean getFirstInApp() {
        return Remember.getBoolean(FIRST_IN_APP, false);
    }

    public static void setOutTradeNo(String outTradeNos) {
        Remember.putString(outTradeNo, outTradeNos);
    }

    public static String getOutTradeNo() {
        return Remember.getString(outTradeNo, "");
    }

    public static void setTime(String time) {
        Remember.putString(TIME, time);
    }

    public static String getTime() {
        return Remember.getString(TIME, "");
    }

    public static void setGoodname(String goodname) {
        Remember.putString(GOODNAME, goodname);
    }

    public static String getGoodname() {
        return Remember.getString(GOODNAME, "");
    }

    public static void setGoodimage(String goodimage) {
        Remember.putString(GOODIMAGE, goodimage);
    }

    public static String getGoodimage() {
        return Remember.getString(GOODIMAGE, "");
    }

    public static void setGoodprice(String goodprice) {
        Remember.putString(GOODPRICE, goodprice);
    }

    public static String getGoodprice() {
        return Remember.getString(GOODPRICE, "");
    }



}
